<?php
/**
 * Created by PhpStorm.
 * User: Tom
 * Date: 2018/7/7
 * Time: 11:02
 */

namespace app\admin\controller;


use think\Controller;
use think\Db;

class Jiayou extends Controller
{
    public function index()
    {
        return $this->fetch();
    }


    public function jyrecord()
    {

        $map = [];
        $list = Db::name('jychongzhi')->where($map)->order("id desc")->paginate(3);
// 把分页数据赋值给模板变量list
        $this->assign('list', $list);

        $show = $list->render();
        $show=preg_replace("(<a[^>]*page[=|/](\d+).+?>(.+?)<\/a>)","<a href='javascript:ajax_page($1);'>$2</a>",$show);
// 渲染模板输出
        $this->assign('page',$show);
        return $this->fetch();
    }

}